create table sys_user
(
    user_id      bigint identity
        constraint PK__sys_user__B9BE370F675B0A0E
            primary key,
    dept_id      bigint,
    user_name    nvarchar(30) not null,
    nick_name    nvarchar(30) not null,
    user_type    nvarchar(2)
        constraint DF_sys_user_user_type default '00',
    email        nvarchar(50)
        constraint DF_sys_user_email default '',
    phonenumber  nvarchar(11)
        constraint DF_sys_user_phonenumber default '',
    sex          nchar
        constraint DF_sys_user_sex default '0',
    avatar       nvarchar(100)
        constraint DF_sys_user_avatar default '',
    password     nvarchar(100)
        constraint DF_sys_user_password default '',
    status       nchar
        constraint DF_sys_user_status default '0',
    del_flag     nchar
        constraint DF_sys_user_del_flag default '0',
    login_ip     nvarchar(128)
        constraint DF_sys_user_login_ip default '',
    login_date   datetime2(0),
    create_by    nvarchar(64)
        constraint DF_sys_user_create_by default '',
    create_time  datetime2(0),
    update_by    nvarchar(64)
        constraint DF_sys_user_update_by default '',
    update_time  datetime2(0),
    remark       nvarchar(500),
    china_nation varchar(2)
)
go

exec sp_addextendedproperty 'MS_Description', '用户信息表', 'SCHEMA', 'dbo', 'TABLE', 'sys_user'
go

exec sp_addextendedproperty 'MS_Description', '用户ID', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'user_id'
go

exec sp_addextendedproperty 'MS_Description', '部门ID', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'dept_id'
go

exec sp_addextendedproperty 'MS_Description', '用户账号', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'user_name'
go

exec sp_addextendedproperty 'MS_Description', '用户昵称', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'nick_name'
go

exec sp_addextendedproperty 'MS_Description', '用户类型（00系统用户）', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN',
     'user_type'
go

exec sp_addextendedproperty 'MS_Description', '用户邮箱', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'email'
go

exec sp_addextendedproperty 'MS_Description', '手机号码', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'phonenumber'
go

exec sp_addextendedproperty 'MS_Description', '用户性别（0男 1女 2未知）', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'sex'
go

exec sp_addextendedproperty 'MS_Description', '头像地址', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'avatar'
go

exec sp_addextendedproperty 'MS_Description', '密码', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'password'
go

exec sp_addextendedproperty 'MS_Description', '帐号状态（0正常 1停用）', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'status'
go

exec sp_addextendedproperty 'MS_Description', '删除标志（0代表存在 2代表删除）', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN',
     'del_flag'
go

exec sp_addextendedproperty 'MS_Description', '最后登录IP', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'login_ip'
go

exec sp_addextendedproperty 'MS_Description', '最后登录时间', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'login_date'
go

exec sp_addextendedproperty 'MS_Description', '创建者', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'create_by'
go

exec sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'create_time'
go

exec sp_addextendedproperty 'MS_Description', '更新者', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'update_by'
go

exec sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'update_time'
go

exec sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'remark'
go

exec sp_addextendedproperty 'MS_Description', '民族（中国）', 'SCHEMA', 'dbo', 'TABLE', 'sys_user', 'COLUMN', 'china_nation'
go

INSERT INTO [ry-vue].dbo.sys_user (user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark, china_nation) VALUES (1, 103, N'admin', N'若依', N'00', N'ry@163.com', N'15888888888', N'1', N'', N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', N'2022-02-28 14:43:54', N'admin', N'2021-12-03 22:22:12', N'', N'2022-02-28 14:43:54', N'管理员', null);
INSERT INTO [ry-vue].dbo.sys_user (user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark, china_nation) VALUES (2, 105, N'ry', N'若依', N'00', N'ry@qq.com', N'15666666666', N'1', N'', N'$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', N'0', N'0', N'127.0.0.1', N'2021-12-03 22:22:12', N'admin', N'2021-12-03 22:22:12', N'admin', N'2021-12-04 15:59:09', N'测试员', null);
INSERT INTO [ry-vue].dbo.sys_user (user_id, dept_id, user_name, nick_name, user_type, email, phonenumber, sex, avatar, password, status, del_flag, login_ip, login_date, create_by, create_time, update_by, update_time, remark, china_nation) VALUES (3, 100, N'test', N'test', N'00', N'12345@qq.com', N'18845678900', N'0', N'', N'$2a$10$5wgjaf3wHruu67axJAmd8uWSG/yK24hKKVH8CaQuQh2OYyOU6e.Bm', N'0', N'0', N'', null, N'admin', N'2021-12-14 21:51:57', N'admin', N'2022-02-25 16:46:38', null, null);